<!DOCTYPE HTML>
<html>
<head>
    <include file="Include:meta"/>
    <title>供应商管理-目的地运营集团数据管理平台</title>
    <include file="Include:style"/>
    <style>
        #upModal label {
            line-height: 30px;
            display: block;
            margin-top: 10px;
        }
    </style>
</head>
<body>
<include file="Include:header"/>
<include file="Include:left"/>
<div id="main">
    <div class="crumbs">
        <div class="crumbs-text">供应商库</div>
        <div class="right">
            <div class="input-group left w250">
                <input type="text" id="keyword" value="{$keyword}" class="form-control" placeholder="按名称/附件搜索"
                       autocomplete="off">
                <span class="input-group-btn">
	        		<button class="btn found_btn" type="button">搜索</button>
		    	</span>
            </div>
            <a href="__APP__/ProductSupplierManage/add" class="btn left ml5">添加</a>
        </div>
    </div>
    <div class="">
        <table class="table table-bordered table-hover">
            <tr class="table-header fixed-table-header">
                <td width="100">
                    <select name="type" class="form-control w100">
                        <option value=""
                        <if condition="$type eq null"> selected</if>
                        >产品类型</option>
                        <foreach name="types" item="vo">
                            <option value="{$vo}"
                            <if condition="$type eq $vo"> selected</if>
                            >{$vo}</option>
                        </foreach>
                    </select>
                </td>
                <td>供应商名称</td>
                <td>联系人</td>
                <td>联系电话</td>
                <!--<td>附件</td>-->
                <td width="200">
                    <select name="province_id" class="form-control w200">
                        <option value=""
                        <if condition="$province_id eq null"> selected</if>
                        >所属地区</option>
                        <foreach name="province" item="vo">
                            <option value="{$vo['id']}"
                            <if condition="$province_id eq $vo['id']"> selected</if>
                            >{$vo['name']}</option>
                        </foreach>
                    </select>
                </td>
                <td width="300">
                    <select name="label" class="form-control w300">
                        <option value=""
                        <if condition="$label eq null"> selected</if>
                        >标签</option>
                        <foreach name="res_label" item="vo">
                            <option value="{$vo}"
                            <if condition="$label eq $vo"> selected</if>
                            >{$vo}</option>
                        </foreach>
                    </select>
                </td>
                <td>内/外部产品</td>
                <td width="140">添加人(日期)</td>
                <td width="100">管理</td>
            </tr>
            <if condition="$result eq NULL">
                <tr>
                    <td class='text-center' colspan="10">暂无相关内容</td>
                </tr>
            </if>
            <foreach name="result" item="vo">
                <tr>
                    <td>{$vo['type']}</td>
                    <td data-placement="right" title="{$vo['intro']}">{$vo['name']}</if>
                    </td>
                    <td>{$vo['linkman']}</td>
                    <td>{$vo['link_phone']?$vo['link_phone']:NULL}</td>
                    <!--<td>
                        <if condition="$vo['file_name'] neq null">{$vo['file_name']}
                            <a href="{$vo['file_url']}" did="{$vo['id']}" target="_blank"
                               data-toggle="tooltip" data-placement="right" title="下载" class="ml5"><i
                                    class="glyphicon glyphicon-download-alt download"></i></a></if>
                    </td>-->
                    <td>{$vo['province_id']?$vo['pro_name']:NULL}{$vo['city_id']?$vo['c_name']:NULL}{$vo['address']?$vo['address']:NULL}</td>
                    <td>{$vo['label']}</td>
                    <td>
                        <if condition="$vo['diff'] eq 1">内部产品
                            <else/>
                            外部产品
                        </if>
                    </td>
                    <td>{:get_userName($vo['add_uid'])}({$vo['add_date']|strtotime|date='Y-m-d',###})</td>
                    <td class="nowrap">
                        <if condition="$vo['file_name'] neq null"><!--{$vo['file_name']}-->
                            <a href="{$vo['file_url']}" did="{$vo['id']}" target="_blank"
                               data-toggle="tooltip" data-placement="left" title="下载" class="ml5">
                                <i class="glyphicon glyphicon-download-alt download"></i>&nbsp;</a>
                            <else/>
                            <a href="javascript:;" style="color: grey" data-toggle="tooltip" data-placement="left" title="无附件"
                               class="ml5"><i class="glyphicon glyphicon-download-alt download"></i>&nbsp;</a></if>
                        <a href="__APP__/ProductSupplierManage/edit/id/{$vo['id']}" data-toggle="tooltip"
                           data-placement="left" title="" class="mr5"
                           data-original-title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
                        <a href="javascript:;" class="delete" data-toggle="tooltip" data-placement="left"
                           title="删除" id="{$vo['id']}"><i class="glyphicon glyphicon-trash"></i></a>
                    </td>
                </tr>
            </foreach>
        </table>
    </div>
    <div class="pages">{$page}</div>
</div>
</div>
<include file="Include:javascript"/>
<script type="text/javascript">
    $(function () {
        $(document).on("change", "[name='type']", function () {
            var val = $(this).val();
            window.location.href = "__APP__/ProductSupplierManage/index/type/" + val;
        });
        $(document).on("change", "[name='province_id']", function () {
            var val = $(this).val();
            window.location.href = "__APP__/ProductSupplierManage/index/province_id/" + val;
        });
        $(document).on("change", "[name='label']", function () {
            var val = $(this).val();
            window.location.href = "__APP__/ProductSupplierManage/index/label/" + val;
        });
        //搜索
        $(".found_btn").keywordSearch("__APP__/ProductSupplierManage/index/keyword/$keyword");
        //删除
        $(".delete").ajaxModal({
            "title_text": "确认提示框",
            "body_text": "您确定要删除吗？",
            "url": "__APP__/ProductSupplierManage/del/id/",
            "data": {"id": "id"}
        });
    });
</script>
</body>
</html>